package org.dromara.bykt.common;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dromara.bykt.utils.MessageUtils;

/**
 * 自定义异常
 *
 * @author 2008030138
 *
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class XxmjException extends RuntimeException {
	private static final long serialVersionUID = 1L;

	private int code;
	private String msg;

	public XxmjException(int code) {
		this.code = code;
		this.msg = MessageUtils.getMessage(code);
	}

	public XxmjException(int code, String msg) {
		this.code = code;
		this.msg = msg;
	}

	public XxmjException(int code, String... params) {
		this.code = code;
		this.msg = MessageUtils.getMessage(code, params);
	}

}
